Solve Service Area

Description

The solve operation is performed on a network layer resource of type service area (layerType is esriNAServerServiceArea).

You can provide arguments to the solve service area operation as query parameters defined in the parameters table below.

Added at 10.5

overrides lets you specify additional settings that can influence the behavior of the solver when finding solutions for the network analysis problems.

Added at 10.4

Pass in a complete JSON representation of a travel mode through travelMode and automatically set override values for various other parameters to quickly and consistently model cars, trucks, a type of truck, and so on.

Added at 10.3

Set travelMode and automatically set override values for various other parameters to quickly and consistently model cars, trucks, a type of truck, and so on.

Added at 10.2.1

timeOfDayIsUTC lets you specify whether timeOfDay is in UTC or the time zone of the facilities. By using UTC, you can have all service areas start or end at the same time regardless of which time zones the facilities are located in.

Added at 10.1

Request parameters

Parameter

Details

f

The response format. The default response format is html.

Values: html | json

facilities

The set of facilities loaded as network locations during analysis. Facilities can be specified using a simple comma / semi-colon based syntax or as a JSON structure. If facilities are not specified, preloaded facilities from the map document are used in the analysis. If an empty json object is passed ('{}') preloaded facilities are ignored.

Syntax and Examples:

Simple syntax:

You can use a simple comma/semicolon-based syntax if you need to specify only facility point geometries in the default spatial reference or WGS84.

Syntax: facilities=x1,y1; x2, y2; ...; xn, yn

Example: facilities=-122.406, 37.7831; -122.405, 37.7827

JSON Structures:

Using JSON structures, you can specify two types of facilities:

  • Features: Facility geometries and attributes expressed as a feature set.
  • Layer: Facilities referencing a data layer in the map service.

Features

You can specify facility geometries as well as attributes using a more comprehensive JSON structure.

The JSON structure can include the following properties:

  • features: Optional. An array of features. Either "features" or "url" property should be specified.
  • url: Optional. REST Query request to a Feature, Map, GP service returning a JSON feature set. Either "features" or "url" property should be specified.
  • type: Optional. The default type is features.
  • doNotLocateOnRestrictedElements: Optional. If true, the features will only be located on streets that are traversible, not on roads that are restricted due to restriction attributes or barriers. Default is true.
  • hasZ: Optional. Indicates if the features geometry contain Z values.

Each feature in this array represents a facility and it contains the following fields:

  • geometry: specifies the facility geometry. The structure for the geometry is same as the structure of the standard ArcGIS REST API point geometry.
  • attributes: key-value pairs where the key is the name of the specified field, and the value is the value for the corresponding field.

Syntax:

{ 
"type" : "features",
"hasZ": <true|false>,
"features"  : [
{
  "geometry" : {<geometry1>},
  "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>}
},
{
  "geometry" : {<geometry2>},
  "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>}
}
],
"doNotLocateOnRestrictedElements" : true | false
}

Example:

{ 
"features"  : [
{
  "geometry" : {"x" : -122.406, "y" : 37.7831},
  "attributes" : {"Name" : "Hospital 1", "Attr_Drivetime" : 15.0}
},
{
  "geometry" : {"x" : -122.405, "y" : 37.7827},
  "attributes" : {"Name" : "Hospital 2", "Attr_Drivetime" : 10.0}
}
]
}

Syntax 2: using url: //This option was added at 10.1.

{ 
  "type" : "features",
  "url" : "<url>",
  "doNotLocateOnRestrictedElements" : true | false
}

Example:

{ 
  "type" : "features",
  "url" : "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/3/query?where=1%3D1&returnGeometry=true&outFields=*&f=json",
  "doNotLocateOnRestrictedElements" : true
}

Layer

You can specify facilities by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer.

The JSON structure can include the following properties:

  • type: The type should be set to layer to indicate that the user is specifying the facilities by referencing a layer.
  • layerName: The name or ID of the data layer in the map service that is being referenced.
  • where: Optional. A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.
  • geometry: Optional. The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. The geometry type is specified using the geometryType property.
  • geometryType: Optional. The type of geometry specified by the geometry property. The geometry type can be an envelope, point, line, or polygon. The default geometry type is an envelope.

    Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope

  • spatialRel: Optional. The spatial relationship to be applied on the input geometry. The supported spatial relationships include intersects, contains, envelope intersects, within, etc. The default spatial relationship is intersects (esriSpatialRelIntersects).

    Values: esriSpatialRelIntersects | esriSpatialRelContains | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin

Syntax:

{ 
  "type" : "layer",
  "layerName" : "<layerName>",
  "where" : "<whereClause>",
  "geometry" : {<geometry>},
  "geometryType" : "<geometryType>",
  "spatialRel" : "<spatialRel>"
}

Example:

{ 
  "type" : "layer",
  "layerName" : "Hospitals",
  "where" : "BEDS > 100"
}

barriers

The set of barriers loaded as network locations during analysis. Barriers can be specified using a simple comma/semicolon-based syntax or as a JSON structure. If barriers are not specified, preloaded barriers from the map document are used in the analysis. If an empty json object is passed ('{}'), preloaded barriers are ignored.

Syntax and Examples:

Simple syntax:

You can use a simple comma/semicolon-based syntax if you need to specify only barrier point geometries in the default spatial reference or WGS84.

Syntax: barriers=x1,y1; x2, y2; ...; xn, yn

Example: barriers=-122.406, 37.7831; -122.405, 37.7827

JSON Structures:

Using JSON structures, you can specify two types of barriers:

  • Features: Barrier geometries and attributes expressed as a feature set.
  • Layer: Barriers referencing a data layer in the map service.

Features

You can specify barrier geometries as well as attributes using a more comprehensive JSON structure.

The JSON structure can include the following properties:

  • features: Optional. An array of features. Either "features" or "url" property should be specified.
  • url: Optional. REST Query request to a Feature, Map, GP service returning a JSON feature set. Either "features" or "url" property should be specified.
  • type: Optional. The default type is features.
  • hasZ: Optional. Indicates if the features geometry contain Z values.

Each feature in this array represents a barrier and it contains the following fields:

  • geometry: specifies the barrier geometry. The structure for the geometry is same as the structure of the standard ArcGIS REST API point geometry.
  • attributes: key-value pairs where the key is the name of the specified field, and the value is the value for the corresponding field.

Syntax:

{ 
"type" : "features",
"hasZ": <true|false>,
"features"  : [
{
  "geometry" : {<geometry1>},
  "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>}
},
{
  "geometry" : {<geometry2>},
  "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>}
}
]
}

Example:

{ 
"features"  : [
{
  "geometry" : {"x" : -122.406, "y" : 37.7831},
  "attributes" : {"Name" : "Barrier 1"}
},
{
  "geometry" : {"x" : -122.405, "y" : 37.7827},
  "attributes" : {"Name" : "Barrier 2"}
}
]
}

Syntax 2: using url: //This option was added at 10.1.

{ 
  "type" : "features",
  "url" : "<url>"
}

Example:

{ 
  "type" : "features",
  "url" : "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/0/query?where=1%3D1&returnGeometry=true&f=json"
}

Layer

You can specify barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer.

The JSON structure can include the following properties:

  • type: The type should be set to layer to indicate that the user is specifying the barriers by referencing a layer.
  • layerName: The name or ID of the data layer in the map service that is being referenced.
  • where: Optional. A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.
  • geometry: Optional. The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API.
  • The geometry type is specified using the geometryType property.

    geometryType: Optional. The type of geometry specified by the geometry property. The geometry type can be an envelope, point, line, or polygon. The default geometry type is an envelope.

    Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope

  • spatialRel: Optional. The spatial relationship to be applied on the input geometry. The supported spatial relationships include intersects, contains, envelope intersects, within, etc. The default spatial relationship is intersects (esriSpatialRelIntersects).

    Values: esriSpatialRelIntersects | esriSpatialRelContains | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin

Syntax:

{ 
  "type" : "layer",
  "layerName" : "<layerName>",
  "where" : "<whereClause>",
  "geometry" : {<geometry>},
  "geometryType" : "<geometryType>",
  "spatialRel" : "<spatialRel>"
}

Example:

{ 
  "type" : "layer",
  "layerName" : "TrafficAccidents",
  "where" : "SEVERITY > 0"
}

polylineBarriers

The set of polyline barriers loaded as network locations during analysis. If polyline barriers are not specified, preloaded polyline barriers from the map document are used in the analysis. If an empty json object is passed ('{}'), preloaded polyline barriers are ignored.

Syntax and Examples:

JSON Structures:

Using JSON structures, you can specify two types of barriers:

  • Features: Polyline barrier geometries and attributes expressed as a feature set.
  • Layer: Polyline barriers referencing a data layer in the map service.

Features

You can specify polyline barrier geometries as well as attributes using a more comprehensive JSON structure.

The JSON structure can include the following properties:

  • features: Optional. An array of features. Either "features" or "url" property should be specified.
  • url: Optional. REST Query request to a Feature, Map, or GP service returning a JSON feature set. Either "features" or "url" property should be specified.
  • type: Optional. The default type is features.
  • hasZ: Optional. Indicates if the features geometry contain Z values.

Each feature in this array represents a barrier and it contains the following fields:

  • geometry: specifies the barrier geometry. The structure for the geometry is same as the structure of the standard ArcGIS REST API polyline geometry.
  • attributes: key-value pairs where the key is the name of the specified field, and the value is the value for the corresponding field.

Syntax:

{ 
"type" : "features",
"hasZ": <true|false>,
"features"  : [
{
  "geometry" : {<polyline1>},
  "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>}
},
{
  "geometry" : {<polyline2>},
  "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>}
}
]
}

Example:

{ 
"features"  : [
{
  "geometry" : {
      "paths" : [ 
     [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ], 
     [ [-97.06326,32.759], [-97.06298,32.755] ]
    ],
    "spatialReference" : {"wkid" : 4326}
    },
  "attributes" : {"Name" : "Barrier 1"}
},
{
  "geometry" : {
     "paths" : [ 
     [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ], 
     [ [-97.06326,32.759], [-97.06298,32.755] ]
    ],
    "spatialReference" : {"wkid" : 4326}
    },
  "attributes" : {"Name" : "Barrier 2"}
}
]
}

Syntax 2: using url: //This option was added at 10.1.

{ 
  "type" : "features",
  "url" : "<url>"
}

Example:

{ 
  "type" : "features",
  "url" : "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/6/query?where=1%3D1&returnGeometry=true&f=json"
}

Layer

You can specify polyline barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer.

The JSON structure can include the following properties:

  • type: The type should be set to layer to indicate that the user is specifying the polyline barriers by referencing a layer.
  • layerName: The name of the data layer in the map service that is being referenced.
  • where: Optional. A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.
  • geometry: Optional. The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. The geometry type is specified using the geometryType property.
  • geometryType: Optional. The type of geometry specified by the geometry property. The geometry type can be an envelope, point, line, or polygon. The default geometry type is an envelope.

    Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope

  • spatialRel: Optional. The spatial relationship to be applied on the input geometry. The supported spatial relationships include intersects, contains, envelope intersects, within, etc. The default spatial relationship is intersects (esriSpatialRelIntersects).

    Values: esriSpatialRelIntersects | esriSpatialRelContains | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin

Syntax:

{ 
  "type" : "layer",
  "layerName" : "<layerName>",
  "where" : "<whereClause>",
  "geometry" : {<geometry>},
  "geometryType" : "<geometryType>",
  "spatialRel" : "<spatialRel>"
}

Example:

{ 
  "type" : "layer",
  "layerName" : "PolylineBarrier"
}

polygonBarriers

The set of polygon barriers loaded as network locations during analysis. If polygon barriers are not specified, preloaded polygon barriers from the map document are used in the analysis. If an empty json object is passed ('{}'), preloaded polygon barriers are ignored.

Syntax and Examples:

JSON Structures:

Using JSON structures, you can specify two types of barriers:

  • Features: Polygon barrier geometries and attributes expressed as a feature set.
  • Layer: Polygon barriers referencing a data layer in the map service.

Features

You can specify polygon barrier geometries as well as attributes using a more comprehensive JSON structure.

The JSON structure can include the following properties:

  • features: Optional. An array of features. Either "features" or "url" property should be specified.
  • url: Optional. REST Query request to a Feature, Map, GP service returning a JSON feature set. Either "features" or "url" property should be specified.
  • type: Optional. The default type is features.
  • hasZ: Optional. Indicates if the features geometry contain Z values.

Each feature in this array represents a barrier and it contains the following fields:

  • geometry: specifies the barrier geometry. The structure for the geometry is same as the structure of the standard ArcGIS REST API polygon geometry.
  • attributes: key-value pairs where the key is the name of the specified field, and the value is the value for the corresponding field.

Syntax:

{ 
"type" : "features",
"features"  : [
{
  "geometry" : {<polygon1>},
  "attributes" : {"<field1>" : <value11>, "<field2>" : <value12>}
},
{
  "geometry" : {<polygon3>},
  "attributes" : {"<field1>" : <value21>, "<field2>" : <value22>}
}
]
}

Example:

{ 
"features"  : [
{
  "geometry" : {
    "rings" : [ 
     [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], 
     [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ]
    ],
    "spatialReference" : {"wkid" : 4326}
    },
  "attributes" : {"Name" : "Barrier 1"}
},
{
  "geometry" : {
    "rings" : [ 
     [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], 
     [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ]
    ],
    "spatialReference" : {"wkid" : 4326}
   },
  "attributes" : {"Name" : "Barrier 2"}
}
]
}

Syntax 2: using url: //This option was added at 10.1.

{ 
  "type" : "features",
  "url" : "<url>"
}

Example:

{ 
  "type" : "features",
  "url" : "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/7/query?where=1%3D1&returnGeometry=true&f=json"
}

Layer

You can specify polygon barriers by referencing a data layer in the map service. Attribute and spatial filters can also be applied on the layer.

The JSON structure can include the following properties:

  • type: The type should be set to layer to indicate that the user is specifying the polygon barriers by referencing a layer.
  • layerName: The name or Id of the data layer in the map service that is being referenced.
  • where: Optional. A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.
  • geometry: Optional. The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. The geometry type is specified using the geometryType property.
  • geometryType: Optional. The type of geometry specified by the geometry property. The geometry type can be an envelope, point, line, or polygon. The default geometry type is an envelope.

    Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope

  • spatialRel: Optional. The spatial relationship to be applied on the input geometry. The supported spatial relationships include intersects, contains, envelope intersects, within, etc. The default spatial relationship is intersects (esriSpatialRelIntersects).

    Values: esriSpatialRelIntersects | esriSpatialRelContains | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin

Syntax:

{ 
  "type" : "layer",
  "layerName" : "<layerName>",
  "where" : "<whereClause>",
  "geometry" : {<geometry>},
  "geometryType" : "<geometryType>",
  "spatialRel" : "<spatialRel>"
}

Example:

{ 
  "type" : "layer",
  "layerName" : "PolygonBarrier"
}

travelMode

Added at 10.4

Travel modes provide override values that help you quickly and consistently model a vehicle or mode of transportation. By setting a travel mode, you don't need to explicitly set values for the following parameters:

  • impedanceAttributeName
  • attributeParameterValues
  • restrictUTurns
  • useHierarchy
  • restrictionAttributeNames
  • outputGeometryPrecision
  • outputGeometryPrecisionUnits

CautionCaution:

When setting travelMode, the service overrides the values of the parameters listed above with those defined in the travel mode, even if you specify their values explicitly in the request.

Example:

To use an existing travel mode that was preconfigured in the service, the typical workflow would be:

  1. Find what travel modes have been preconfigured for the service, by making a call to the retrieveTravelMode operation on the service. For example, http://<my server>:6080/arcgis/rest/services/<service name>/NAServer/ServiceArea/retrieveTravelModes?f=pjson

  2. In the JSON that is returned, look up the supportedTravelModes name, whose value is an array containing the various travel modes.

    Example supportedTravelModes value.

    {
     "defaultTravelMode": "1",
     "supportedTravelModes": [
      {
       "name": "Driving Time",
       "id": "1",
       "type": "AUTOMOBILE",
       "description": "Finds the best route in a car minimizing time.",
       "timeAttributeName": "TravelTime",
       "distanceAttributeName": "Meters",
       "impedanceAttributeName": "TravelTime",
       "restrictionAttributeNames": [
        "Oneway",
        "Driving an Automobile"
       ],
       "attributeParameterValues": [
        {
         "attributeName": "Oneway",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving an Automobile",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving a Truck",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        }
       ],
       "useHierarchy": true,
       "uturnAtJunctions": "esriNFSBAtDeadEndsAndIntersections",
       "simplificationTolerance": 10,
       "simplificationToleranceUnits": "esriMeters"
      },
      {
       "name": "Trucking Distance",
       "id": "2",
       "type": "TRUCK",
       "description": "Finds the best route in a truck minimizing distance.",
       "timeAttributeName": "Minutes",
       "distanceAttributeName": "Meters",
       "impedanceAttributeName": "Meters",
       "restrictionAttributeNames": [
        "Driving a Truck",
        "Oneway"
       ],
       "attributeParameterValues": [
        {
         "attributeName": "Oneway",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving an Automobile",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving a Truck",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        }
       ],
       "useHierarchy": true,
       "uturnAtJunctions": "esriNFSBNoBacktrack",
       "simplificationTolerance": 10,
       "simplificationToleranceUnits": "esriMeters"
      }
     ] 
    }
    

  3. The defaultTravelMode tag has the id of the travel mode that was configured to be used by default. So in the above example, you would get the travel mode with "id" : "1" if you wanted the default travel mode.
  4. Pass the JSON for the travel mode as the travelMode parameter value. So in the case you wanted to pass in the default travel mode, you would pass in the following:

    Example: travelMode parameter value.

    {
       "name": "Driving Time",
       "id": "1",
       "type": "AUTOMOBILE",
       "description": "Finds the best route in a car minimizing time.",
       "timeAttributeName": "TravelTime",
       "distanceAttributeName": "Meters",
       "impedanceAttributeName": "TravelTime",
       "restrictionAttributeNames": [
        "Oneway",
        "Driving an Automobile"
       ],
       "attributeParameterValues": [
        {
         "attributeName": "Oneway",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving an Automobile",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        },
        {
         "attributeName": "Driving a Truck",
         "parameterName": "Restriction Usage",
         "value": "Prohibited"
        }
       ],
       "useHierarchy": true,
       "uturnAtJunctions": "esriNFSBAtDeadEndsAndIntersections",
       "simplificationTolerance": 10,
       "simplificationToleranceUnits": "esriMeters"
      }
    

    NoteNote:

    It is not required to pass in the same exact information as an existing travel mode. You can start from an existing travel mode and just change some of the settings prior to passing it in. Or you can create your own travel mode JSON with whatever values you want as long as it conforms to the correct schema.

attributeParameterValues

A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle.

The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversible. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicles height is greater than the clearance, the edge is restricted.

Parameterized cost attributes that can reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog, or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversible network paths can be adjusted with respect to changes in traffic speeds.

Syntax:

[ 
{
  "attributeName" : "<attribute1>",
  "parameterName" : "<parameter1>",
  "value" : "<value1>"
}, 
{
  "attributeName" : "<attribute2>",
  "parameterName" : "<parameter2>",
  "value" : "<value2>"
}
]

Example:

[
{ 
  "attributeName" : "Time",
  "parameterName" : "65 MPH",
  "value" : "5.0"
}
]

defaultBreaks

A comma-separated list of doubles. The default is defined in the network analysis layer.

excludeSourcesFromPolygons

A comma-separated list of string names. The default is defined in the network analysis layer.

mergeSimilarPolygonRanges

If true, similar ranges will be merged in the result polygons. The default is defined in the network analysis layer.

Values: true | false

outputLines

The type of lines(s) generated. The default is as defined in the network analysis layer.

If esriNAOutputLineTrueShape is specified, the useHierarchy parameter will be ignored since the hierarchy cannot be used.

Values: esriNAOutputLineNone | esriNAOutputLineTrueShape | esriNAOutputLineTrueShapeWithMeasure

outputPolygons

The type of polygon(s) generated. The default is as defined in the network analysis layer.

Values: esriNAOutputPolygonNone | esriNAOutputPolygonSimplified | esriNAOutputPolygonDetailed

overlapLines

Indicates if the lines should overlap from multiple facilities. The default is defined in the network analysis layer.

Values: true | false

overlapPolygons

Indicates if the polygons for all facilities should overlap. The default is defined in the network analysis layer.

Values: true | false

splitLinesAtBreaks

If true, lines will be split at breaks. The default is defined in the network analysis layer.

Values: true | false

splitPolygonsAtBreaks

If true, polygons will be split at breaks. The default is defined in the network analysis layer.

Values: true | false

trimOuterPolygon

If true, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer.

Values: true | false

trimPolygonDistance

If polygons are being trimmed, provides the distance to trim. The default is defined in the network analysis layer.

trimPolygonDistanceUnits

If polygons are being trimmed, specifies the units of the trimPolygonDistance. The default is defined in the network analysis layer.

Values esriUnknownUnits | esriInches | esriPoints | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriMeters | esriKilometers | esriDecimalDegrees | esriDecimeters

returnFacilities

If true, facilities will be returned with the analysis results. Default is false.

The facilities are available in the facilities property of the JSON response.

Values: true | false

returnBarriers

If true, barriers will be returned with the analysis results. Default is false.

The barriers are available in the barriers property of the JSON response.

Values: true | false

returnPolylineBarriers

If true, polyline barriers will be returned with the analysis results. Default is false.

The polyline barriers are available in the polylineBarriers property of the JSON response.

Values: true | false

returnPolygonBarriers

If true, polygon barriers will be returned with the analysis results. Default is false.

The polygon barriers are available in the polygonBarriers property of the JSON response.

Values: true | false

outSR

The well-known ID of the spatial reference for the geometries returned with the analysis results. If outSR is not specified, the geometries are returned in the spatial reference of the map.

accumulateAttributeNames

The list of network attribute names to be accumulated with the analysis. The default is as defined in the network analysis layer.

The value should be specified as a comma separated list of attribute names.

You can also specify a value of none to indicate that no network attributes should be accumulated.

Example: accumulateAttributeNames=WalkingMinutes,Meters

impedanceAttributeName

The network attribute name to be used as the impedance attribute in analysis. The default is as defined in the network analysis layer.

Example: impedanceAttributeName=DrivingMinutes

restrictionAttributeNames

The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the network analysis layer.

The value should be specified as a comma separated list of attribute names.

You can also specify a value of none to indicate that no network attributes should be used as restrictions.

Example: restrictionAttributeNames=Oneway

restrictUTurns

Specifies how U-Turns should be restricted in the analysis. The default is as defined in the network analysis layer.

Values: esriNFSBAllowBacktrack | esriNFSBAtDeadEndsOnly | esriNFSBNoBacktrack | esriNFSBAtDeadEndsAndIntersections

outputGeometryPrecision

The precision of the output geometry after generalization. If 0, no generalization of output geometry is performed. The default is as defined in the network service configuration. If present and positive, it represents the MaximumAllowableOffset parameter - generalization is performed according to IPolycurve.Generalize.

Example: outputGeometryPrecision=0.5

outputGeometryPrecisionUnits

The units of the output geometry precision. The default value is esriUnknownUnits

Values: esriUnknownUnits | esriCentimeters | esriDecimalDegrees | esriDecimeters | esriFeet | esriInches | esriKilometers | esriMeters | esriMiles | esriMillimeters | esriNauticalMiles | esriPoints | esriYards

useHierarchy

If true, the hierarchy attribute for the network should be used in analysis. The default is as defined in the network layer. This cannot be used in conjunction with outputLines.

Values: true | false

timeOfDay

The date and time at the facility. If travelDirection is set to esriNATravelDirectionToFacility, the timeOfDay value specifies the arrival time at the facility. if travelDirection is set to esriNATravelDirectionFromFacility, the timeOfDay value is the departure time from the facility.

The time zone for timeOfDay is specified by timeOfDayIsUTC.

Values: specified by number of milliseconds since midnight January 1st, 1970.

timeOfDayIsUTC

This option was added at 10.2.1.

The time zone or zones of the timeOfDay parameter.

When set to false, which is the default value, the timeOfDay parameter refers to the time zone or zones in which the facilities are located. Therefore, the start or end times of the service areas are staggered by time zone.

Setting timeOfDay to 9:00 a.m., today and timeOfDayIsUTC to false causes service areas to be generated for 9:00 a.m. Eastern Time for any facilities in the Eastern Time Zone, 9:00 a.m. Central Time for facilities in the Central Time Zone, 9:00 a.m. Mountain Time for facilities in the Mountain Time Zone, and so on, for facilities in different time zones. The time is always 9:00 a.m. local time, but staggered in real time. (Even though local times are used in this example, timeOfDay is set as the number of milliseconds since midnight January 1, 1970 UTC to 9:00 a.m., today UTC, and the UTC time zone is ignored.)

If stores in a chain that span the U.S. open at 9:00 a.m. local time, this parameter value could be chosen to find market territories at opening time for all stores in one solve. First, the stores in the Eastern Time Zone open and a polygon is generated, stores open an hour later in Central Time, and so on.

A true value for timeOfDayIsUTC indicates the timeOfDay parameter refers to Coordinated Universal Time (UTC). Therefore, all facilities are reached or departed from simultaneously, regardless of the time zone or zones they are in.

Setting timeOfDay to 2:00 p.m., today and timeOfDayIsUTC to true causes service areas to be generated for 9:00 a.m. Eastern Standard Time for any facilities in the Eastern Time Zone, 8:00 a.m. Central Standard Time for facilities in the Central Time Zone, 7:00 a.m. Mountain Standard Time for facilities in the Mountain Time Zone, and so on, for facilities in different time zones. (The 2:00 p.m., today UTC value is specified in timeOfDay as the number of milliseconds since midnight January 1, 1970 UTC to 9:00 a.m., today UTC.)

NoteNote:

The scenario above assumes standard time. During daylight saving time, the Eastern, Central, and Mountain times would each be one hour ahead (that is, 10:00, 9:00, and 8:00 a.m., respectively).

One of the cases in which the UTC option is useful is to visualize emergency-response coverage for a jurisdiction that is split into two time zones. The emergency vehicles are specified in facilities. timeOfDay is set to now in UTC. (You need to determine the current time and date in UTC anc convert it to milliseconds to correctly use this option.) Other parameters are set, and the analysis is solved. Even though a time-zone boundary divides the vehicles, the results show areas that can be reached given current traffic conditions. This same process can be used for other times as well, not just for now.

Values: true | false

travelDirection

Options for traveling to or from the facility. The default is defined in the network analysis layer.

Values: esriNATravelDirectionFromFacility | esriNATravelDirectionToFacility

returnZ

This option was added at 10.1.

If true, Z values will be included in saPolygons and saPolylines geometry if the network dataset is Z-aware. The default is false.

overrides

Specify additional settings that can influence the behavior of the solver when finding solutions for the network analysis problems.

The value for this parameter needs to be specified in JavaScript Object Notation (JSON). The values can be either a number, Boolean, or a string.

{
"overrideSetting1" : "value1", 
"overrideSetting2" : "value2"
}

The default value for this parameter is no value, which indicates not to override any solver settings.

Overrides are advanced settings that should be used only after careful analysis of the results obtained before and after applying the settings. A list of supported override settings for each solver and their acceptable values can be obtained by contacting EsriTechnical Support.

Example Usage

Solve Service Area for 1 Facility.

https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Service Area/solveServiceArea?facilities={"features":[{"attributes": {"Name": "San Francisco Museum of Modern Art","Breaks_Length" : 10.0},"geometry":{"x":-122.401134465,"y":37.7857056500001}}]}&barriers={}&polylineBarriers={}&polygonBarriers={}&defaultBreaks=5.0&excludeSourcesFromPolygons=&mergeSimilarPolygonRanges=false&overlapLines=false&overlapPolygons=false&splitLinesAtBreaks=false&splitPolygonsAtBreaks=false&trimOuterPolygon=false&trimPolygonDistance=100.0&trimPolygonDistanceUnits=esriMeters&outSR=26911&accumulateAttributeNames=&impedanceAttributeName=Length&restrictionAttributeNames=&attributeParameterValues=&restrictUTurns=esriNFSBAllowBacktrack&returnFacilities=true&returnBarriers=true&returnPolylineBarriers=false&returnPolygonBarriers=false&outputLines=esriNAOutputLineNone&outputPolygons=esriNAOutputPolygonSimplified&travelDirection=esriNATravelDirectionFromFacility&outputGeometryPrecision=0.01&outputGeometryPrecisionUnits=esriMeters&f=pjson

JSON Response Syntax

{
  "saPolygons"        : {
                          "spatialReference" : { <spatialReference> },
						  "hasZ": <true|false>,
						  "hasM": <true|false>,
                          "features" : [ <array of <polygon>  features> ] 
                        },
  "saPolylines"       : { 
                          "spatialReference" : { <spatialReference> },
						  "hasZ": <true|false>,
						  "hasM": <true|false>,
                          "features" : [ <array of <polyline> features> ] 
                        },
  "facilities"        : { 
                          "spatialReference" : { <spatialReference> },
						  "hasZ": <true|false>,
                          "features" : [ <array of <point>    features> ] 
                        },
  "barriers"          : { 
                          "spatialReference" : { <spatialReference> },
						  "hasZ": <true|false>,
                          "features" : [ <array of <point>    features> ] 
                        },
  "polylineBarriers"  : { 
                          "spatialReference" : { <spatialReference> },
						  "hasZ": <true|false>,
                          "features" : [ <array of <polyline> features> ] 
                        },
  "polygonBarriers"   : { 
                          "spatialReference" : { <spatialReference> },
                          "features" : [ <array of <polygon>  features> ] 
                        },
  "messages"          : [ {<message1>}, {<message2>},... ]
}

where each features object is defined as:

  "features": [
  {
    "attributes": {
      "<field1>": <value11>,
      "<field2>": <value12>
    },
    "geometry": {<geometry1>}
  },
  {
    "attributes": {
      "<field1>": <value21>,
      "<field2>": <value22>
    },
    "geometry": {<geometry2>}
  }
  ]


and each message is defined as:

{ "type" : <type1>, "description" : <description1> }

JSON Response Example

{
"saPolygons": {
  "features": [
  {
    "attributes": {
      "ObjectID": 1,
      "FacilityID: 3,
      "Name": "Some name",
      "FromBreak": 0.0,
      "ToBreak": 10.0,
      "Shape_Length": 0.171641389705288
    },
    "geometry" : {
      "rings" : [ 
       [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], 
       [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ]
      ],
      "spatialReference" : {"wkid" : 4326}
    }
  }    
  ]
}, 
"facilities" : {
  "features": [
  {
    "attributes": {
      "ObjectID": 1,
        "Name": "Location 1",
        "Sequence": 1,
        "TimeWindowStart": null,
        "TimeWindowEnd": null,
        "ArriveCurbApproach": 1,
        "DepartCurbApproach": 2
    },
    "geometry": { "x": -122.4079, "y": 37.7835 }
  },
  {
    "attributes": {
      "ObjectID": 2,
        "Name": "Location 2",
        "Sequence": 2,
        "TimeWindowStart": null,
        "TimeWindowEnd": null,
        "ArriveCurbApproach": 1,
        "DepartCurbApproach": 2
    },
    "geometry": { "x": -122.3931, "y": 37.79496 }
  }
  ]
},
"barriers": {
  "features": [
  {
    "attributes": {
      "ObjectID": 1,
      "Name": "Barrier 1",
      "SourceID": 1,
      "SourceOID": 9619,
      "PosAlong": 0.841037735851507,
      "SideOfEdge": 2,
      "CurbApproach": null,
      "Status": 0
    },
    "geometry": { "x": -122.41, "y": 37.7889 }
  }
  ]
},
messages": [
  {
    "type": 50,
    "description": "Some message 1."
  },
  {
    "type": 50,
    "description": "Some message 2."
  }
]
}